gtv

type gtv

Generic Transfer Value (GTV) is a general-purpose type for sending and decoding any data structure.

Since

0.9.0

Functions

Link copied to clipboard
pure static function from_bytes(bytes: byte_array): gtv

Decodes a gtv from a byte_array. Fails if it cannod be decoded.

Link copied to clipboard
pure static function from_bytes_or_null(bytes: byte_array): gtv?

Tries to decode a gtv from a byte_array and returns null if it fails.

Link copied to clipboard
pure static function from_json(json: json): gtv

Decodes a gtv from a json representation.

pure static function from_json(json: text): gtv

Decodes a gtv from a JSON string representation.

Link copied to clipboard
(alias) pure static function fromBytes(bytes: byte_array): gtv

Decodes a gtv from a byte_array. Fails if it cannod be decoded.

Link copied to clipboard
(alias) pure static function fromJSON(json: json): gtv

Decodes a gtv from a json representation.

Alias
(alias) pure static function fromJSON(json: text): gtv

Decodes a gtv from a JSON string representation.

Alias
Link copied to clipboard
pure function to_bytes(): byte_array

Encodes this gtv to a byte_array.

Link copied to clipboard
pure function to_json(): json

Encodes this gtv to a json representation.

Link copied to clipboard
(alias) pure function toBytes(): byte_array

Encodes this gtv to a byte_array.

Alias
Link copied to clipboard
(alias) pure function toJSON(): json

Encodes this gtv to a json representation.

Alias